************************************************************************************************
************************************************************************************************
**             																				  **
**																							  **
** REVEALING "MAFIA INC."? FINANCIAL CRISIS, ORGANIZED CRIME AND THE BIRTH OF NEW ENTERPRISES **
**																							  **
** 									       (APPENDIX)									  **
**																							  **
************************************************************************************************
************************************************************************************************
************************************************************************************************

** NOTE:	
* Run on STATA 15 for MacOS Catalina and Windows 10
* To run it is required the installation of the  packages:
*															- spmap
* 															- reg2hdfespatial
* 															- reghdfe
* 															- acreg
* 															- outreg2
* 															- spatwmat
* 															- spatgsa
* 															- spatcorr


*________________________________________ SETTING WORKING DIRECTORY
global dirin "PUT HERE THE DIRECTORY OF THE FOLDER RAW_DATA"
global dirin2 "PUT HERE THE DIRECTORY OF THE FOLDER CLEANED_DATA"
global dirout "PUT HERE THE DIRECTORY OF THE FOLDER RESULTS_APPENDIX"


*________________________________________ OPENING LOG FILE
log using ${dirout}Appendix.log, replace


*________________________________________ LOADING DATA
use ${dirin2}final_database.dta, clear


*________________________________________ FIGURES

******** FIGURE A.2
preserve
import excel ${dirin}bls.xlsx, sheet("Foglio1") firstrow clear
bysort year: egen bls=sum(pre_bis_supp)
replace bls=-bls
twoway  (line bls year, lc(black)), xlabel(2003(1)2013, labs(small)) /*
*/ytitle("BLS Diffusion Index") xtitle("") graphregion(color(white)) /*
*/legend(off) xline(2006,lc(black) lp(dash)) yline(0, lc(black) lp(dot))
graph export ${dirout}figA2.eps, replace
restore


******** FIGURE A.3
** Panel (a): TMI-Pre
spmap tmi_q3_pre using ${dirin}prov_coord if year==2007,  graphregion(color(white)) title("(a): TMI-Pre") id(_ID) fcolor(Greys)  /*
*/ legend(label(1 "Excluded sample") label(2 "1st quaritle") label(3 "2nd quaritle") label(4 "3rd quaritle"))
graph save ${dirout}figA3_a.gph, replace

** Panel (b): PSI
spmap psi_e using ${dirin}prov_coord if year==2007, graphregion(color(white)) title("(b): PSI") id(_ID) fcolor(Greys) /*
*/ legend(label(1 "Excluded sample") label(2 "No Mafia (PSI = 0)") label(3 "Mafia (PSI > 0)"))
graph save ${dirout}figA3_b.gph, replace

** Panel (c): Art.416-bis
spmap mafia_ass using ${dirin}prov_coord if year==2007, graphregion(color(white)) title("(c): Art.416-bis") id(_ID) fcolor(Greys) /*
*/ legend(label(1 "Excluded sample") label(2 "No Mafia (Art.416-bis offences = 0)") label(3 "Mafia (Art.416-bis offences > 0)"))
graph save ${dirout}figA3_c.gph, replace

cd ${dirout}
graph combine figA3_a.gph figA3_b.gph figA3_c.gph, c(3) graphregion(color(white))
graph export ${dirout}figA3.eps, replace 



******** FIGURE A.4
foreach var2 in mafia_n4 mafia_n5 tmi_cont /*
*/ mafia_n3_pre mafia_n4_pre mafia_n5_pre tmi_cont_pre /*
*/ psi_e mafia_ass{
gen `var2'_2=`var2'
}
label var mafia_n4_2 "(a): TMI quartile"
label var mafia_n5_2 "(b): TMI quintile"
label var tmi_cont_2 "(c): TMI continuous"
label var mafia_n3_pre_2 "(d): TMI-pre tertile"
label var mafia_n4_pre_2 "(e): TMI-pre quartile"
label var mafia_n5_pre_2 "(f): TMI-pre quintile"
label var tmi_cont_pre_2 "(g): TMI-pre continuous"
label var psi_e_2 "(h): PSI"
label var mafia_ass_2 "(i): Art.416-bis"


foreach var2 in mafia_n4 mafia_n5 tmi_cont /*
*/ mafia_n3_pre mafia_n4_pre mafia_n5_pre tmi_cont_pre /*
*/ psi_e mafia_ass{
local varlabel1: var label `var2'
foreach var1 in  year_7 year_8 year_9  year_11 year_12 year_13 year_14 year_15 year_16 year_17 {
local varlabel2: var label `var1'
gen `var1'_`var2'=`var1'*`var2'
label var `var1'_`var2' "`varlabel1' x `varlabel2'"
}
local vtext : variable label `var2'_2
reg2hdfespatial new_std_ln year_7_`var2' year_8_`var2' year_9_`var2'  year_11_`var2' year_12_`var2' year_13_`var2' year_14_`var2' year_15_`var2' year_16_`var2' year_17_`var2' /*
*/ pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north, /*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
parmest, sav(${dirout}figA4_`var2', replace) level(90 95 99)label
drop *_`var2'
preserve
use ${dirout}figA4_`var2'.dta, clear
keep if strpos(parm, "`var2'")
set obs `=_N+1'
replace label="Mafia x (t-1)" if label==""
replace parm="year_10_`var2'" if parm==""
foreach var in estimate stderr dof t p min90 max90 min95 max95 min99 max99 {
replace `var'=0 if `var'==.
}
tab parm, sort
replace parm=subinstr(parm,"_`var2'","",.)
replace parm=subinstr(parm,"year_","",.)
destring parm, replace
labmask parm, values(label)
drop label

twoway (scatter estimate parm, mcolor(black) msymbol(circle) msize(small)) (rcap min99 max99 parm, lcolor(gs10)) /*
*/ (rcap min95 max95 parm, lcolor(gs5)) (rcap min90 max90 parm, lcolor(black)) , title("`vtext'", c(black) s(small))/*
*/ xlabel(, valuelabels angle(0) labsize(vsmall)) xtitle("") legend(off) graphregion(color(white)) bgcolor(white) /*
*/ xlabel(7(1)17,angle(45) labs(small)) yline(0, lpattern(dash) lc(black)) xline(10, lc(black) lp(dash))  ytitle("Point estimate") ylabel(, labs(tiny))
graph save ${dirout}figA4_`var2'.gph, replace
restore
drop `var2'_2
label var `var2' "Mafia"
}

cd ${dirout}
graph combine figA4_mafia_n4.gph figA4_mafia_n5.gph figA4_tmi_cont.gph /*
*/figA4_mafia_n3_pre.gph figA4_mafia_n4_pre.gph figA4_mafia_n5_pre.gph figA4_tmi_cont_pre.gph /*
*/ figA4_psi_e.gph figA4_mafia_ass.gph, graphregion(color(white)) 
graph export ${dirout}figA4.eps, replace



******** FIGURE A.5
foreach var2 in mafia_n3_all  mafia_n3_nopuglia{
gen `var2'_2=`var2'
}
label var mafia_n3_all_2 "(a): All regions"
label var mafia_n3_nopuglia_2 "(b): No Apulia"

foreach var2 in mafia_n3_all mafia_n3_nopuglia{
local varlabel1: var label `var2'
foreach var1 in  year_7 year_8 year_9  year_11 year_12 year_13 year_14 year_15 year_16 year_17 {
local varlabel2: var label `var1'
gen `var1'_`var2'=`var1'*`var2'
label var `var1'_`var2' "`varlabel1' x `varlabel2'"
}
local vtext : variable label `var2'_2
reghdfe new_std_ln year_7_`var2' year_8_`var2' year_9_`var2'  year_11_`var2' year_12_`var2' year_13_`var2' year_14_`var2' year_15_`var2' year_16_`var2' year_17_`var2' /*
*/ pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north  if year>=2003, a(id year) cluster(id#year)
parmest, sav(${dirout}figA5_`var2', replace) level(90 95 99)label
drop *_`var2'
preserve
use ${dirout}figA5_`var2'.dta, clear
keep if strpos(parm, "`var2'")
set obs `=_N+1'
replace label="Mafia x (t-1)" if label==""
replace parm="year_10_`var2'" if parm==""
foreach var in estimate stderr dof t p min90 max90 min95 max95 min99 max99 {
replace `var'=0 if `var'==.
}
tab parm, sort
replace parm=subinstr(parm,"_`var2'","",.)
replace parm=subinstr(parm,"year_","",.)
destring parm, replace
labmask parm, values(label)
drop label

twoway (scatter estimate parm, mcolor(black) msymbol(circle) msize(small)) (rcap min99 max99 parm, lcolor(gs10)) /*
*/ (rcap min95 max95 parm, lcolor(gs5)) (rcap min90 max90 parm, lcolor(black)) , title("`vtext'", c(black) s(small))/*
*/ xlabel(, valuelabels angle(0) labsize(vsmall)) xtitle("") legend(off) graphregion(color(white)) bgcolor(white) /*
*/ xlabel(7(1)17,angle(45) labs(small)) yline(0, lpattern(dash) lc(black)) xline(10, lc(black) lp(dash))  ytitle("Point estimate") ylabel(, labs(vsmall))
graph save ${dirout}figA5_`var2'.gph, replace
restore
drop `var2'_2
label var `var2' "Mafia"
}

cd ${dirout}
graph combine  figA5_mafia_n3_all.gph figA5_mafia_n3_nopuglia.gph, ycommon graphregion(color(white)) 
graph export ${dirout}figA5.eps, replace


******** FIGURE A.6
reg2hdfespatial new_std_ln *_mafia_n3 pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north /*
*/ *_big_banks_2006 *_tourism_2006 *_wastes_xc_2006 *_self_emp_2006 *_pop_urb_2006 *_blood_2006 *_newspapers_ln_2006 *_trial_2006,/*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
parmest, sav(${dirout}figA6, replace) level(90 95 99)label
test _b[year_7_mafia_n3]=_b[year_8_mafia_n3]=_b[year_9_mafia_n3]=0
preserve
use ${dirout}figA6.dta, clear
keep if strpos(parm, "mafia_n3")
set obs `=_N+1'
replace label="Mafia x (t-1)" if label==""
replace parm="year_10_mafia_n3" if parm==""
foreach var in estimate stderr dof t p min90 max90 min95 max95 min99 max99 {
replace `var'=0 if `var'==.
}
tab parm, sort
replace parm=subinstr(parm,"_mafia_n3","",.)
replace parm=subinstr(parm,"year_","",.)
destring parm, replace
labmask parm, values(label)
drop label
twoway (scatter estimate parm, mcolor(black) msymbol(circle) msize(small)) (rcap min99 max99 parm, lcolor(gs10)) /*
*/ (rcap min95 max95 parm, lcolor(gs5)) (rcap min90 max90 parm, lcolor(black)) , /*
*/ xlabel(, valuelabels angle(0) labsize(vsmall)) xtitle("") legend(off) graphregion(color(white)) bgcolor(white) /*
*/ xlabel(7(1)17,angle(45) labs(small)) yline(0, lpattern(dash) lc(black)) xline(10, lc(black) lp(dash))  ytitle("Point estimate") ylabel(, labs(small))
graph export ${dirout}figA6.eps, replace
restore


******** FIGURE A.7
** Panel (a): DSP X Year 
reg2hdfespatial new_std_ln *_mafia_n3  pop_urb tourism trial wastes_xc big_banks /*
*/  self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north /*
*/ year_7_north year_8_north year_9_north *_dsp, timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
parmest, sav(${dirout}figA7_a, replace) level(90 95 99)label
preserve
use ${dirout}figA7_a.dta, clear
keep if strpos(parm, "mafia_n3")
set obs `=_N+1'
replace label="Mafia x (t-1)" if label==""
replace parm="year_10_mafia_n3" if parm==""
foreach var in estimate stderr dof t p min90 max90 min95 max95 min99 max99 {
replace `var'=0 if `var'==.
}
tab parm, sort
replace parm=subinstr(parm,"_mafia_n3","",.)
replace parm=subinstr(parm,"year_","",.)
destring parm, replace
labmask parm, values(label)
drop label
twoway (scatter estimate parm, mcolor(black) msymbol(circle) msize(small)) (rcap min99 max99 parm, lcolor(gs10)) /*
*/ (rcap min95 max95 parm, lcolor(gs5)) (rcap min90 max90 parm, lcolor(black)) , title("(a): DSP ", s(small) c(black))	/*
*/ xlabel(, valuelabels angle(0) labsize(vsmall)) xtitle("") legend(off) graphregion(color(white)) bgcolor(white) /*
*/ xlabel(7(1)17,angle(45) labs(small)) yline(0, lpattern(dash) lc(black)) xline(10, lc(black) lp(dash))  ytitle("Point estimate") ylabel(, labs(small))
graph save ${dirout}figA7_a.gph, replace
restore

** Panel (a): Supply of Credit
reg2hdfespatial new_std_ln *_mafia_n3  pop_urb tourism trial wastes_xc big_banks /*
*/  self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north /*
*/ credit_ln , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
parmest, sav(${dirout}figA7_b, replace) level(90 95 99)label
preserve
use ${dirout}figA7_b.dta, clear
keep if strpos(parm, "mafia_n3")
set obs `=_N+1'
replace label="Mafia x (t-1)" if label==""
replace parm="year_10_mafia_n3" if parm==""
foreach var in estimate stderr dof t p min90 max90 min95 max95 min99 max99 {
replace `var'=0 if `var'==.
}
tab parm, sort
replace parm=subinstr(parm,"_mafia_n3","",.)
replace parm=subinstr(parm,"year_","",.)
destring parm, replace
labmask parm, values(label)
drop label
twoway (scatter estimate parm, mcolor(black) msymbol(circle) msize(small)) (rcap min99 max99 parm, lcolor(gs10)) /*
*/ (rcap min95 max95 parm, lcolor(gs5)) (rcap min90 max90 parm, lcolor(black)) , title("(b): Credit ", s(small) c(black))	/*
*/ xlabel(, valuelabels angle(0) labsize(vsmall)) xtitle("") legend(off) graphregion(color(white)) bgcolor(white) /*
*/ xlabel(7(1)17,angle(45) labs(small)) yline(0, lpattern(dash) lc(black)) xline(10, lc(black) lp(dash))  ytitle("Point estimate") ylabel(, labs(small))
graph save ${dirout}figA7_b.gph, replace
restore

cd ${dirout}
graph combine figA7_a.gph figA7_b.gph,  graphregion(color(white))
graph export ${dirout}figA7.eps, replace



******** FIGURE A.8
spmap co using ${dirin}prov_coord if year==2007,  graphregion(color(white)) id(_ID) fcolor(Greys) legend(label(1 "Excluded sample/No Data"))
graph export ${dirout}figA8.eps, replace



******** FIGURE A.9
reg2hdfespatial new_std_ln *_tmi_q3_2 *_tmi_q3_3  pop_urb tourism trial wastes_xc big_banks /*
*/  self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north /*
*/ year_7_north year_8_north year_9_north, timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
parmest, sav(${dirout}figA9, replace) level(90 95 99)label
preserve
use ${dirout}figA9.dta, clear
keep if strpos(parm, "tmi_q3_2")
set obs `=_N+1'
replace label="Mid Mafia x (t-1)" if label==""
replace parm="year_10_tmi_q3_2" if parm==""
foreach var in estimate stderr dof t p min90 max90 min95 max95 min99 max99 {
replace `var'=0 if `var'==.
}
tab parm, sort
replace parm=subinstr(parm,"_tmi_q3_2","",.)
replace parm=subinstr(parm,"year_","",.)
destring parm, replace
labmask parm, values(label)
drop label
twoway (scatter estimate parm, mcolor(black) msymbol(circle) msize(small)) (rcap min99 max99 parm, lcolor(gs10)) /*
*/ (rcap min95 max95 parm, lcolor(gs5)) (rcap min90 max90 parm, lcolor(black)) , 	/*
*/ xlabel(, valuelabels angle(0) labsize(vsmall)) xtitle("") legend(off) graphregion(color(white)) bgcolor(white) /*
*/ xlabel(7(1)17,angle(45) labs(small)) yline(0, lpattern(dash) lc(black)) xline(10, lc(black) lp(dash))  ytitle("Point estimate") ylabel(, labs(small))
graph export ${dirout}figA9.eps, replace
restore



******** FIGURE A.10
foreach var2 in big_banks   wastes_xc  tourism/*
*/  self_emp trial pop_urb blood newspapers_ln {

label var big_banks "(a): Big banks (perc.)"
label var wastes_xc "(d): Wastes per capita (tons)"
label var tourism "(c): Tourism index"
label var self_emp "(b): Self-employed (perc.)"
label var trial "(e): Trial duration (days)"
label var pop_urb "(f): Urban population (perc.)"
label var blood "(h): Blood donations (Bags per 100 inh.)"
label var newspapers_ln "(g): Newspaper circulation (1,000 inh., Ln)"

local vtext : variable label `var2'
reghdfe `var2' year_7_mafia_n3 year_8_mafia_n3 year_9_mafia_n3 year_11_mafia_n3 year_12_mafia_n3 year_13_mafia_n3 year_14_mafia_n3 year_15_mafia_n3 year_16_mafia_n3 year_17_mafia_n3/*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north if year>=2003,/*
*/ a(year id) vce(robust)
parmest, sav(${dirout}figA10_`var2', replace) level(90 95 99)label
preserve
use ${dirout}figA10_`var2'.dta, clear
keep if strpos(parm, "mafia_n3")
set obs `=_N+1'
replace label="Mafia x (t-1)" if label==""
replace parm="year_10_mafia_n3" if parm==""
foreach var in estimate stderr dof t p min90 max90 min95 max95 min99 max99 {
replace `var'=0 if `var'==.
}
tab parm, sort
replace parm=subinstr(parm,"_mafia_n3","",.)
replace parm=subinstr(parm,"year_","",.)
destring parm, replace
labmask parm, values(label)
drop label

twoway (scatter estimate parm, mcolor(black) msymbol(circle) msize(small)) (rcap min99 max99 parm, lcolor(gs10)) /*
*/ (rcap min95 max95 parm, lcolor(gs5)) (rcap min90 max90 parm, lcolor(black)) , title("`vtext'", c(black) s(small))/*
*/ xlabel(, valuelabels angle(0) labsize(vsmall)) xtitle("") legend(off) graphregion(color(white)) bgcolor(white) /*
*/ xlabel(7(1)17,angle(45) labs(small)) yline(0, lpattern(dash) lc(black)) xline(10, lc(black) lp(dash))  ytitle("Point estimate") ylabel(, labs(tiny))
graph save ${dirout}figA10_`var2'.gph, replace
restore
}

cd ${dirout}
graph combine figA10_big_banks.gph figA10_self_emp.gph figA10_tourism.gph figA10_wastes_xc.gph /*
*/  figA10_trial.gph figA10_pop_urb.gph figA10_newspapers_ln.gph  figA10_blood.gph , graphregion(color(white))  
graph export ${dirout}figA10.eps, replace



******** FIGURE A.11
preserve
keep if name_reg!="campania" & name_reg!="calabria" & name_reg!="sicilia"
keep if year==2007
spatwmat, name(weights) ycoord(latitude) xcoord(longitude) band(0,75000)
spatgsa  mafia_n3, w(weights) moran
spatcorr mafia_n3, bands(0 25000 50000 100000 200000 400000) xcoord(longitude) ycoord(latitude) graph
graph export ${dirout}figA11.eps, replace
restore



*________________________________________ TABLES

******** TABLE A.1
** Col. (1): TMI quartile
preserve
rename crisis_mafia_n4_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north, /*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA1, label nonotes keep(flag) replace nocons /*
*/ addtext(Measure, TMI Quartile, Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (2): TMI quintile
preserve
rename crisis_mafia_n5_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north, /*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA1, label nonotes keep(flag) nocons /*
*/ addtext(Measure, TMI Quintile, Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (3): TMI continuous
preserve
rename crisis_mafia_cont_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north, /*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA1, label nonotes keep(flag) nocons /*
*/ addtext(Measure, TMI Cont. , Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (4): TMI-Pre tertile
preserve
rename crisis_mafia_n3_pre_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north, /*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA1, label nonotes keep(flag) nocons /*
*/ addtext(Measure, TMI-pre Tertile, Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (5): TMI-Pre quartile
preserve
rename crisis_mafia_n4_pre_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north, /*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA1, label nonotes keep(flag) nocons /*
*/ addtext(Measure,TMI-pre Quartile , Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (6): TMI-Pre quintile
preserve
rename crisis_mafia_n5_pre_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north, /*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA1, label nonotes keep(flag) nocons /*
*/ addtext(Measure, TMI-pre Quintile , Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (7): TMI-Pre continuous
preserve
rename crisis_mafia_cont_pre_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north, /*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA1, label nonotes keep(flag) nocons /*
*/ addtext(Measure, TMI-pre Cont. , Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (8): PSI
preserve
rename crisis_mafia_psi flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north, /*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA1, label nonotes keep(flag) nocons /*
*/ addtext(Measure, PSI, Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (9): Art.416 bis
preserve
rename crisis_mafia_ass_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north, /*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA1, label nonotes keep(flag) nocons /*
*/ addtext(Measure, Art.416-bis, Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore



******** TABLE A.2
** Col. (1): All provinces
preserve
rename crisis_mafia_n3_all_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north /*
*/ year_7_north year_8_north year_9_north  , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
outreg2 using ${dirout}tabA2, label nonotes keep(flag) nocons replace/*
*/ addtext(Spec.,Sample All region, Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (2): Dropping Apulia
preserve
rename crisis_mafia_n3_nopuglia_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north /*
*/ year_7_north year_8_north year_9_north  , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
outreg2 using ${dirout}tabA2, label nonotes keep(flag) nocons/*
*/ addtext(Spec.,Sample Exclusion Apulia, Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (3): Credit env.
preserve
rename crisis_mafia_n3_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north /*
*/ *_big_banks_2006, timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA2, label nonotes keep(flag) nocons /*
*/ addtext(Spec.,Trends Credit Env., Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (4): Economic env.
preserve
rename crisis_mafia_n3_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/  year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north /*
*/ *_tourism_2006 *_wastes_xc_2006 *_self_emp_2006, timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA2, label nonotes keep(flag) nocons /*
*/ addtext(Spec.,Trends Economic Env., Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (5): Social env.
preserve
rename crisis_mafia_n3_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/  year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north /*
*/ *_pop_urb_2006 *_blood_2006 *_newspapers_ln_2006 *_trial_2006, timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA2, label nonotes keep(flag) nocons /*
*/ addtext(Spec., Trends Social Env., Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (6): All controls
preserve
rename crisis_mafia_n3_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks self_emp  blood newspapers_ln  /*
*/ year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north /*
*/ *_big_banks_2006 *_tourism_2006 *_wastes_xc_2006 *_self_emp_2006 *_pop_urb_2006 *_blood_2006 *_newspapers_ln_2006 *_trial_2006,/*
*/ timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA2, label nonotes keep(flag) nocons /*
*/ addtext(Spec., All Trends, Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (7): Domestic stability pact
preserve
rename crisis_mafia_n3_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north /*
*/ year_7_north year_8_north year_9_north *dsp , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA2, label nonotes keep(flag) nocons/*
*/ addtext(Spec., Extra Control DSP X Year, Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore

** Col. (8): Supply of Credit 
preserve
rename crisis_mafia_n3_int flag
reg2hdfespatial new_std_ln flag pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln credit_ln  year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north /*
*/ year_7_north year_8_north year_9_north, timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11) 
outreg2 using ${dirout}tabA2, label nonotes keep(flag) nocons/*
*/ addtext(Spec., Extra Control Credit, Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore


******** TABLE A.3
preserve
** Lower Panel: First stage
acreg  crisis_mafia_n3_int instrument crisis if year>=2003,  pfe1(id)  id(id) time(year) latitude(latitude_180) longitude(longitude_180) dist(200) lag(11) spatial hac 
outreg2 using ${dirout}tabA3_first, label nonotes keep(instrument) replace nocons/*
*/ addtext(Prov. FE, YES, Year FE, NO, North X Year FE, NO, Controls, NO)  ct("`vtext'") tex(frag) text dec(3) 

acreg crisis_mafia_n3_int instrument if year>=2003,  pfe1(id) pfe2(year) id(id) time(year) latitude(latitude_180) longitude(longitude_180) dist(200) lag(11) spatial hac 
outreg2 using ${dirout}tabA3_first, label nonotes keep(instrument)  nocons/*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, NO, Controls, NO)  ct("`vtext'") tex(frag) text dec(3) 

acreg   crisis_mafia_n3_int instrument  year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north if year>=2003, /*
*/ pfe1(id) pfe2(year) id(id) time(year) latitude(latitude_180) longitude(longitude_180) dist(200) lag(11) spatial hac 
outreg2 using ${dirout}tabA3_first, label nonotes keep(instrument)  nocons/*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, NO)  ct("`vtext'") tex(frag) text dec(3) 

acreg  crisis_mafia_n3_int instrument pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln if year>=2003,  pfe1(id) pfe2(year) id(id) time(year) latitude(latitude_180) longitude(longitude_180) dist(200) lag(11) spatial hac 
outreg2 using ${dirout}tabA3_first, label nonotes keep(instrument)  nocons/*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, NO, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 

acreg  crisis_mafia_n3_int instrument  pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north if year>=2003, /*
*/ pfe1(id) pfe2(year) id(id) time(year) latitude(latitude_180) longitude(longitude_180) dist(200) lag(11) spatial hac 
outreg2 using ${dirout}tabA3_first, label nonotes keep(instrument)  nocons/*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 

**  Upper Panel: Second stage
acreg  new_std_ln (crisis_mafia_n3_int=instrument) if year>=2003,  pfe1(id) pfe2(crisis) id(id) time(year) latitude(latitude_180) longitude(longitude_180) dist(200) lag(11) spatial hac correctr2
outreg2 using ${dirout}tabA3_second, label nonotes keep(crisis_mafia_n3_int) replace nocons/*
*/ addtext(Prov. FE, YES, Year FE, NO, North X Year FE, NO, Controls, NO)  ct("`vtext'") tex(frag) text dec(3) 

acreg  new_std_ln (crisis_mafia_n3_int=instrument) if year>=2003,  pfe1(id) pfe2(year) id(id) time(year) latitude(latitude_180) longitude(longitude_180) dist(200) lag(11) spatial hac correctr2
outreg2 using ${dirout}tabA3_second, label nonotes keep(crisis_mafia_n3_int)  nocons/*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, NO, Controls, NO)  ct("`vtext'") tex(frag) text dec(3) 

acreg  new_std_ln (crisis_mafia_n3_int=instrument)  year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north if year>=2003, /*
*/ correctr2 pfe1(id) pfe2(year) id(id) time(year) latitude(latitude_180) longitude(longitude_180) dist(200) lag(11) spatial hac 
outreg2 using ${dirout}tabA3_second, label nonotes keep(crisis_mafia_n3_int)  nocons/*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, NO)  ct("`vtext'") tex(frag) text dec(3) 

acreg  new_std_ln (crisis_mafia_n3_int=instrument)   pop_urb tourism trial wastes_xc big_banks /*
*/  self_emp  blood newspapers_ln if year>=2003,  pfe1(id) pfe2(year) id(id) time(year) latitude(latitude_180) longitude(longitude_180) dist(200) lag(11) spatial hac correctr2
outreg2 using ${dirout}tabA3_second, label nonotes keep(crisis_mafia_n3_int)  nocons/*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, NO, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 

acreg  new_std_ln (crisis_mafia_n3_int=instrument)   pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north year_17_north year_7_north year_8_north year_9_north if year>=2003, /*
*/ correctr2 pfe1(id) pfe2(year) id(id) time(year) latitude(latitude_180) longitude(longitude_180) dist(200) lag(11) spatial hac 
outreg2 using ${dirout}tabA3_second, label nonotes keep(crisis_mafia_n3_int)  nocons/*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 
restore


******** TABLE A.4
preserve
keep new_std construction_std  limited_std ric_std gdp_xc un_rate tot_exp_r proc_std fund_eu_std closed_std registered_std  tmi_e tmi_pre_e psi_e mafia_ass /*
*/ big_banks pop_urb wastes_xc tourism self_emp trial blood newspapers name_prov name_reg year 
keep if year>2002 & name_reg!="campania" & name_reg!="calabria" & name_reg!="sicilia"
sum new_std construction_std limited_std ric_std gdp un_rate tot_exp_r proc_std fund_eu_std closed_std registered_std  tmi_e tmi_pre_e psi mafia_ass /*
*/ big_banks pop_urb wastes_xc tourism self_emp trial blood newspapers
restore



******** TABLE A.5
preserve
drop if id==.
gen diff_credit=(credit_tot-l.credit_tot)/l.credit_tot
label var diff_credit "Change credit"
local vtext : variable label diff_credit
reghdfe diff_credit crisis_mafia_n3_int, a(year id) cluster(id) 
outreg2 using ${dirout}tabA5, label nonotes replace keep(crisis_mafia_n3_int) nocons addtext(Prov. FE, YES, Year FE, YES)  ct("`vtext'") tex(frag) text dec(3) 
reghdfe diff_credit *_mafia_n3 i.year, a(year id) cluster(id) 
outreg2 using ${dirout}tabA5, label nonotes keep(*_mafia_n3) nocons addtext(Prov. FE, YES, Year FE, YES) ct("`vtext'") tex(frag) text dec(3)
restore



******** TABLE A.6

** Col. (1): Construction
reg2hdfespatial construction_std_ln crisis_mafia_n3_int  pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north /*
*/ year_17_north year_7_north year_8_north year_9_north  , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
outreg2 using ${dirout}tableA6, label nonotes keep(crisis_mafia_n3_int) nocons replace /*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 

** Col. (2): Limited Liability Companies
reg2hdfespatial limited_std_ln crisis_mafia_n3_int  pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north /*
*/ year_17_north year_7_north year_8_north year_9_north  , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
outreg2 using ${dirout}tableA6, label nonotes keep(crisis_mafia_n3_int) nocons /*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 

** Col. (3): Research
reg2hdfespatial ric_std_ln crisis_mafia_n3_int  pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north /*
*/ year_17_north year_7_north year_8_north year_9_north  , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
outreg2 using ${dirout}tableA6, label nonotes keep(crisis_mafia_n3_int) nocons /*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 

** Col. (4): GDP 
reg2hdfespatial ln_gdp crisis_mafia_n3_int  pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north /*
*/ year_17_north year_7_north year_8_north year_9_north  , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
parmest, sav(${dirout}figA4_d, replace) level(90 95 99)label
outreg2 using ${dirout}tableA6, label nonotes keep(crisis_mafia_n3_int) nocons /*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 

** Col. (5): Unemployment rate
reg2hdfespatial un_rate crisis_mafia_n3_int  pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north /*
*/ year_17_north year_7_north year_8_north year_9_north  , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
outreg2 using ${dirout}tableA6, label nonotes keep(crisis_mafia_n3_int) nocons /*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 

** Col. (6): Export/GDP
reg2hdfespatial tot_exp_r crisis_mafia_n3_int  pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north /*
*/ year_17_north year_7_north year_8_north year_9_north  , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
outreg2 using ${dirout}tableA6, label nonotes keep(crisis_mafia_n3_int) nocons /*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 

** Col. (7): Pubblic Procurement
reg2hdfespatial proc_std_ln crisis_mafia_n3_int  pop_urb tourism trial wastes_xc big_banks /*
*/ self_emp  blood newspapers_ln year_11_north year_12_north year_13_north year_14_north year_15_north year_16_north /*
*/ year_17_north year_7_north year_8_north year_9_north  , timevar(year) panelvar(id) lat(latitude) lon(longitude) distcutoff(200) lagcutoff(11)
outreg2 using ${dirout}tableA6, label nonotes keep(crisis_mafia_n3_int) nocons /*
*/ addtext(Prov. FE, YES, Year FE, YES, North X Year FE, YES, Controls, YES)  ct("`vtext'") tex(frag) text dec(3) 



log close
